package com.sm.imlibrary.model;

import com.sm.imlibrary.imsdk.SIMMessage;

/**
 * 消息工厂
 */
public class MessageFactory {

    /**
     * 消息工厂方法
     */
    public static Message getMessage(SIMMessage message) {
        switch (message.getType()){
            case Text:
            case Face:
                return new TextMessage(message);
//            case Image:
//                return new ImageMessage(message);
//            case Sound:
//                return new VoiceMessage(message);
//            case Video:
//                return new VideoMessage(message);
//            case GroupTips:
//                return new GroupTipMessage(message);
//            case File:
//                return new FileMessage(message);
//            case Custom:
//                return new CustomMessage(message);
//            case UGC:
//                return new UGCMessage(message);
            default:
                return null;
        }
    }
}
